		<ol class="breadcrumb">
			<li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;{{__('Personal Center')}}</a></li>
		  <li><a href="/user_cates/mine?model={{$cate_model}}">用户分类管理</a></li>
		  <li class="active">新增分类</li>
		</ol>
       <hr>
       
       <?php
       	if($this->action == 'edit') {$action == 'edit';}
else{  $action = '/'.$this->action.'/'.$cate_model;}
        ?>
		{{$this->Form->create('UserCate',array('action'=> $action,'class'=>'form-horizontal','role'=>'form'))}}
			{{if $_GET['multilan']}}
			<ul class="nav nav-tabs"  role="tablist">
				<li role="presentation" class="active"><a href="#chi-info" aria-controls="home" role="tab" data-toggle="tab">中文</a></li>
		    	<li role="presentation"><a href="#eng-info" aria-controls="home" role="tab" data-toggle="tab">英文</a></li>
			</ul>
			{{/if}}
			
			
			<div class="tab-content">				
				<div role="tabpanel" class="tab-pane active" id="chi-info">
					<div class="form-group">
						<label class="col-sm-2 control-label" for="UserCateParentId">上级分类</label>
						<div class="col-sm-9 controls">
							{{$this->Form->input('parent_id',array('class'=>'form-control','div'=>false,'label'=>false))}}
							<p><small>不选择上级分类时，为一级分类</small></p>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="UserCateName">分类名称</label>
						<div class="col-sm-9 controls">
							{{$this->Form->hidden('id')}}
							{{$this->Form->hidden('referer',array('value'=>'/user_cates/mine?model='.$cate_model))}}
							{{$this->Form->hidden('model',array('value'=>$cate_model))}}
							{{$this->Form->hidden('locale',array('value'=>'zh_cn'))}}
							{{$this->Form->input('name',array('class'=>'form-control','div'=>false,'label'=>false))}}
						</div>
					</div>
					{{if $cate_model=='Schedule'}}
					<div class="form-group">
						<label class="col-sm-2 control-label" for="UserCatePublished">开放访问</label>
						<div class="col-sm-9 controls">
							{{$this->Form->input('published',array('class'=>'form-control','options'=>array('0'=>'否','1'=>是),'div'=>false,'label'=>false))}}
						</div>
					</div>
					<div class="form-group form-inline">
						<label class="col-sm-2 control-label" for="UserCateColor">背景颜色</label>
						<div class="col-sm-9 controls">
							{{$this->Form->input('bgcolor',array('class'=>'colorPicker form-control','after'=>'<p>请选择浅色</p>','div'=>false,'label'=>false))}}
						</div>
					</div>
					{{/if}}
					<script type="text/javascript" src="/js/colorPicker.all.min.js"></script>
	<script type="text/javascript" src="/js/jqColorPicker.js"></script>
	<script type="text/javascript" src="/js/tinycolor-min.js"></script>
					{{if $_GET['withcover']}}
					<div class="form-group">
						<label class="col-sm-2 control-label" for="UserCateCoverimg">封面图片</label>
						<div class="col-sm-9 controls select">
							{{$this->Swfupload->load('coverimg',array(
							'label'=>false,'modelClass'=>'UserCate',
							'no_db'=>1,'upload_limit'=>1,
							'file_types'=> '*.jpg;*.gif;*.png;*.bmp',
							'isadmin'=>false
							))}}
						</div>
					</div>
					{{/if}}
				</div>
				{{if $_GET['multilan']}}
				<div role="tabpanel" class="tab-pane" id="eng-info">
					<div class="form-group">
						<label class="col-sm-2 control-label" for="UserCateI18nName">分类名称</label>
						<div class="col-sm-9 controls">
							{{$this->Form->hidden('UserCateI18n.zh_cn.id')}}
							{{$this->Form->input('UserCateI18n.zh_cn.name',array('class'=>'form-control','div'=>false,'label'=>false))}}
						</div>
					</div>
				</div>
				{{/if}}
	
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9"><input class="btn btn-primary" type="submit" value="提交"></div>
			</div>
		{{$this->Form->end()}}
	</div>
	<style>
	.colorPicker {color:#FFF !important;}
	</style>
	<script>
	
	

	$('.colorPicker').colorPicker({
	    customBG: '#FFF',
	    size:2,
	    mode:'hsv-h', //rgb-r
	    init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
	    	if( elm.value == '') {elm.value='#89B6DB';} 
	      elm.style.backgroundColor = elm.value;
	      
	      var color1 = tinycolor(elm.value);
	  	  var luminance = color1.getLuminance(); // 1
	  	
	      elm.style.color = luminance > 0.22 ? '#FFF' : '#FFF';
	    }
	});

	
	</script>